package cn.lg.soar.system.general.mapper;

import cn.lg.soar.system.general.entity.UserConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 用户配置
 * @author luguoxiang
 * @since 2023-07-13
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
public interface UserConfigMapper extends BaseMapper<UserConfig> {

    @Select("SELECT `value` FROM lg_sys_user_config a INNER JOIN lg_sys_user_config_group b ON a.group_id=b.id " +
            "WHERE b.`code`=#{code} AND a.user_id=#{userId}")
    String getConfig(@Param("userId") long userId, @Param("code") String code);

}
